In the case of welding a plurality of the same products by a welding machine, welding positions of the products are photographed with a camera, and the welding positions are corrected, based on the photographed images (refer to Patent Literature 1).
One of the plurality of products is referred to as a master serving as a reference, and the other products are referred to as workpieces. In Patent Literature 1, in the event of correcting the welding positions, edge images (outline images) of the products are used. By using the edge images, even when the products have stains, scratches, diffusion and the like, pattern-matching between an image of the master and images of the workpieces is performed without being influenced by these stains, scratches, diffusion and the like to a large extent, thus making it possible to correct the welding positions.